package com.cc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dy.cc.Goods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【goods】的数据库操作Mapper
* @createDate 2024-11-20 10:07:40
* @Entity com.cc.domain.Goods
*/
public interface GoodsMapper extends BaseMapper<Goods> {

    List<Goods> findAll(@Param("goods") Goods goods);

    @Select("select g.*,u.name uname ,u.image image from goods g left join user u on g.uid=u.id where g.uid=#{uid}  ORDER BY g.sales desc")
    List<Goods> xiao(@Param("uid") Integer uid);

    @Select("select g.*,u.name uname ,u.image image from goods g left join user u on g.uid=u.id where g.uid=#{uid}  ORDER BY g.uptime desc")
    List<Goods> shang(Integer uid);

    List<Goods> sousuo( @Param("goods") Goods goods);

    @Select("select g.*,u.name uname ,u.image image from goods g left join user u on g.uid=u.id where g.uid=#{uid}")
    List<Goods> find(Integer uid);

    @Select("select g.*,u.name uname,u.image image from goods g left join user u on g.uid=u.id where g.uid=#{uid}")
    List<Goods> All(Goods goods, Integer uid);

    @Select("select * from goods ")
    List<Goods> findList(Goods goods);

    @Select("select g.*,u.name uname,u.image image from goods g left join user u on g.uid=u.id where g.uid=#{uid} order by g.sales desc  limit 3")
    List<Goods> fAll(Goods goods);

    @Select("select g.*,u.name uname,u.image image from goods g left join user u on g.uid=u.id where  g.uid=#{uid} order by g.sales desc  limit 3")
    List<Goods> xiaoAll(Goods goods);

    @Select("select g.*,u.name uname,u.image image from goods g left join user u on g.uid=u.id where g.uid=#{uid} order by g.uptime desc  limit 3")
    List<Goods> shangAll(Goods goods);
}




